package com.banyiyi.simple.pattern.observer;

import lombok.Builder;

/**
 * @ClassName Consumer
 * @Description 订阅者（用户）
 * @Author yangwm
 * @Date 2023/2/15 11:27
 * @Version 1.0
 */
@Builder
public class Consumer implements Observer{
    private String name;

    @Override
    public void responce() {
        System.out.println("用户 "+name +" 接收到数据更新通知");
    }

    // 构造类传入参数
    public Consumer(String name){
        this.name = name;
    }

    // 保留空参构造器
    public Consumer(){}


}
